package com.example.study.design.chain;

import com.example.study.model.RequestData;

import java.util.Objects;

/**
 * 具体处理者A
 *
 * @author duckquan
 */
public class HandlerA extends Handler {

    @Override
    public void handle(RequestData requestData) {
        System.out.println("HandlerA 执行代码逻辑! 处理: " + requestData.getData());
        requestData.setData(requestData.getData().replace("A", ""));
        if (Objects.nonNull(successor)) {
            successor.handle(requestData);
        } else {
            System.out.println("执行中止!");
        }
    }

}
